package com.bdqn.Service;

//import javafx.print.Paper;

import java.awt.print.Paper;

public class Printer<Ink> {
    private Ink ink =null;
    private Paper paper=null;

    /**
     * 打印方法
     * @param message 要打印的内容
     */
    public void print(String message){
        //输出颜色标记
//        System.out.println("使用"+ink.getClass(255,200,0)+"颜色打印");
        System.out.println("使用"+ink.getColor(255, 200, 0)+"颜色打印:\n");
        //逐字符输出到纸张
        for (int i=0;i<message.length();++i){
            paper.putInChar(message.charAt(i));
        }
        //将纸张的内容输出
        System.out.println(paper.getContent);
    }

    /**
     * 设值注入所需的setter方法
     * @param ink 墨盒
     */
    public void setInk(Ink ink){
        this.ink=ink;
}

    /**
     * 设值注入所需的setter
     * @param paper 纸张
     */
    public void setPaper(Paper paper){
        this.paper=paper;
}
}
